<template>
  <div class="list">
    <div v-for="item in list" :key="item.name">
      {{ item.name }}
      <!-- 调用自身 作为一个组件 递归必须要组件有name属性 -->
      <my-list :list='item.children'/>
    </div>
  </div>
</template>

<script>
export default {
  name: "MyList",
  props: ["list"],
  data() {
    return {};
  },

  created() {},

  methods: {},
};
</script>

<style scoped lang='less'>
</style>
